from  selenium.webdriver.common.by import By

class HandeTable():
    def __init__(self,tbody_element):
        self.tbody = tbody_element

    def col_values(self,col):
        """
        获取表格中，指定列的值
        :col:第col列
        :return: 列表
        """
        lst = []
        trs = self.tbody.find_elements(*(By.TAG_NAME,'tr'))
        for tr in trs:
            lst.append(tr.find_elements(*(By.TAG_NAME,'td'))[col - 1].text)
        return lst



